//JSONP跨域，express写服务器
const express = require('express');
var app = express();
app.get('/api', (req, res) => {
    let posts = ['js', 'php'];
    res.end(`onResponse(${JSON.stringify(posts)})`);//onResponse函数在前台
});
app.listen(9090, () => { console.log(9090) });